package com.asset.dispoal.business.bsEvidenceRecognition.service;

import com.asset.dispoal.business.bsEvidenceRecognition.api.BusinessDataManageService;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.ContractEvidenceRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.ContractEvidenceResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.DeleteContractEvidenceRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceDeleteRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceListRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceListResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryFileRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryFileResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.IdCardRefreshHistoryCaseRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.IdCardRefreshHistoryCaseResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.IdCardRefreshHistoryResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.AddressExtraceCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.DeleteEvidenceCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.DeleteSingleContractEvidenceCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.EvidenceCaseMatchResultCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.EvidenceMatchCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.EvidenceMatchResult2Command;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.EvidenceMatchResult3Command;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.EvidenceMatchResultCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.EvidenceMergeResultCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.IdCardExtraceCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.QueryEvidenceListCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.QueryEvidenceMatchHistoryCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.QueryEvidenceMatchHistoryFileCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.QueryIdCardRefreshCasePageCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.QueryIdCardRefreshPageCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.QuerySingleContractEvidenceCommand;
import com.asset.dispoal.business.bsEvidenceRecognition.service.commom.RefreshCaseStateCommand;
import com.asset.dispoal.business.match.dto.MatchRequest;
import com.asset.dispoal.business.match.dto.RefreshCaseStateRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.core.local.GlobalHeaderThreadLocal;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

import java.util.List;
import java.util.Map;

/**
 * @author qr
 * @date 2022/5/10$
 */
@Service
public class BusinessDataManageServiceImpl implements BusinessDataManageService {

    @Autowired
    EvidenceMatchCommand evidenceMatchCommand;

    @Autowired
    EvidenceMatchResultCommand evidenceMatchResultCommand;

    @Autowired
    EvidenceCaseMatchResultCommand evidenceCaseMatchResultCommand;

    @Autowired
    EvidenceMatchResult2Command evidenceMatchResult2Command;

    @Autowired
    EvidenceMatchResult3Command evidenceMatchResult3Command;

    @Autowired
    QueryEvidenceListCommand queryEvidenceListCommand;

    @Autowired
    DeleteEvidenceCommand deleteEvidenceCommand;

    @Autowired
    QueryEvidenceMatchHistoryCommand queryEvidenceMatchHistoryCommand;

    @Autowired
    QueryEvidenceMatchHistoryFileCommand queryEvidenceMatchHistoryFileCommand;

    @Autowired
    private QuerySingleContractEvidenceCommand querySingleContractEvidenceCommand;

    @Autowired
    private DeleteSingleContractEvidenceCommand deleteSingleContractEvidenceCommand;

    @Autowired
    private EvidenceMergeResultCommand evidenceMergeResultCommand;

    @Autowired
    private RefreshCaseStateCommand refreshCaseStateCommand;

    @Autowired
    IdCardExtraceCommand idCardExtraceCommand;

    @Autowired
    AddressExtraceCommand addressExtraceCommand;

    @Autowired
    QueryIdCardRefreshPageCommand queryIdCardRefreshPageCommand;

    @Autowired
    QueryIdCardRefreshCasePageCommand queryIdCardRefreshCasePageCommand;

    @Override
    public Result evidenceIdentification(EvidenceMatchRequest request) {
        return evidenceMatchCommand.execute(request);
    }

    @Override
    public Result evidenceMatchResult(MatchRequest matchRequest) {
        return evidenceMatchResultCommand.execute(matchRequest);
    }

    @Override
    public Result<PageVO<EvidenceListResponse>> queryEvidenceList(EvidenceListRequest request) {
        return queryEvidenceListCommand.execute(request);
    }

    @Override
    public Result deleteEvidence(EvidenceDeleteRequest request) {
        return deleteEvidenceCommand.execute(request);
    }

    @Override
    public Result<PageVO<EvidenceMatchHistoryResponse>> queryMatchHistory(EvidenceMatchHistoryRequest request) {
        return queryEvidenceMatchHistoryCommand.execute(request);
    }

    @Override
    public Result<PageVO<EvidenceMatchHistoryFileResponse>> queryMatchHistoryFile(EvidenceMatchHistoryFileRequest request) {
        return queryEvidenceMatchHistoryFileCommand.execute(request);
    }

    @Override
    public Result<List<ContractEvidenceResponse>> queryContractEvidenceById(ContractEvidenceRequest request) {
        return querySingleContractEvidenceCommand.execute(request);
    }

    @Override
    public Result deleteSingleDataByContractId(DeleteContractEvidenceRequest request) {
        request.setUserId(GlobalHeaderThreadLocal.getOrException().getUserId());
        return deleteSingleContractEvidenceCommand.execute(request);
    }

    @Override
    public Result refreshCaseState(RefreshCaseStateRequest request) {
        return refreshCaseStateCommand.execute(request);
    }

    @Override
    public Result mergeCallBack(MatchRequest matchRequest) {
        return evidenceMergeResultCommand.execute(matchRequest);
    }

    @Override
    public Result idCardCallBack(MatchRequest request) {
        return idCardExtraceCommand.execute(request);
    }

    @Override
    public Result addressCallBack(MatchRequest request) {
        return addressExtraceCommand.execute(request);
    }

    @Override
    public Result evidenceMatchResult2(Map map) {
        return evidenceMatchResult2Command.execute(map);
    }

    @Override
    public Result evidenceMatchResult3(Map map) {
        return evidenceMatchResult3Command.execute(map);
    }

    @Override
    public Result<PageVO<IdCardRefreshHistoryResponse>> queryIdCardRefreshPage(EvidenceMatchHistoryRequest request) {
        return queryIdCardRefreshPageCommand.execute(request);
    }

    @Override
    public Result<PageVO<IdCardRefreshHistoryCaseResponse>> queryIdCardRefreshCasePage(IdCardRefreshHistoryCaseRequest request) {
        return queryIdCardRefreshCasePageCommand.execute(request);
    }

    @Override
    public Result evidenceCaseMatchResult(MatchRequest request) {
        return evidenceCaseMatchResultCommand.execute(request);
    }
}
